import { createRouter, createWebHashHistory } from "vue-router";
import Index from '../views/index.vue';
import CourseList from '../views/courseList.vue';
 
const routes = [
    {
        path: "/",
        name: "仪表盘",
        component: Index,
    },
    {
        path: "/commonSettings",
        name: "常用设置",
        children: [
            {
                path: "/teacher",
                name: "教师管理",
                component: Index,
            },
            {
                path: "/student",
                name: "学生管理",
                component: Index,
            },
            {
                path: "/announcementManagement",
                name: "公告管理",
                component: Index,
            },
            {
                path: "/systemSettings",
                name: "系统设置",
                component: Index,
            },
            {
                path: "/determineTheServer",
                name: "判断服务器",
                component: Index,
            }
        ]
    },
    {
        path: "/problem",
        name: "问题",
        children: [
            {
                path: "/problemList",
                name: "问题列表",
                component: Index,
            },
            {
                path: "/addQuestionst",
                name: "增加题目",
                component: Index,
            },
            {
                path: "/importAndExportQuestions",
                name: "导入导出题目",
                component: Index,
            }
        ]
    },
    {
        path: "/competitionPractice",
        name: "比赛&练习",
        children: [
            {
                path: "/competitioList",
                name: "比赛列表",
                component: Index,
            },
            {
                path: "/addCompetitio",
                name: "创建比赛",
                component: Index,
            }
        ]
    },
    {
        path: "/course",
        name: "课程",
        children: [
            {
                path: "/courseList",
                name: "课程列表",
                component: CourseList,
            },
            {
                path: "/addCourse",
                name: "创建课程",
                component: Index,
            }
        ]
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router;